package exercises.Charpter9;

import interfaces.interfaceprocessor.Processor;

class TestAdapter{
	String reverse(String str){
		char[] charString = str.toCharArray();
		String ans = new String();
		
		for(int j = charString.length - 1; j >= 0; j--){
			ans = ans + charString[j];
		}
		return ans.toString();
	}
}

class Adapter implements Processor{
	TestAdapter test;
	public Adapter(TestAdapter test){
		this.test = test;
	}
	@Override
	public String name(){
		return test.reverse("Test Reverse String!");
	}
	@Override
	public Object process(Object input) {
		return input;
	}
}

public class Eleven {
	public static void main(String[] args){
		Adapter test = new Adapter(new TestAdapter());
		System.out.println(test.name());
	}
}
